<?php

class Application_Model_DbTable_Ruta extends Zend_Db_Table_Abstract
{

    protected $_name = 'rutas';
    const COMPRA_ATENDIDO = 1;
    const NO_COMPRA_ATENDIDO = 2;

    
    public function actualizarInfoRuta($dia, $idCliente, $idUsuario, $idAtendido = 1){
    	
    	/*$logger = new Zend_Log();
			$writer = new Zend_Log_Writer_Stream(APPLICATION_LOGS_INV);
			$logger->addWriter($writer);	        
	        $logger->log('$dia: ' .  $dia, Zend_Log::INFO);
	        $logger->log('$idCliente: ' .  $idCliente, Zend_Log::INFO);
	        $logger->log('$idUsuario: ' .  $idUsuario, Zend_Log::INFO);*/
    	
		$where[] = new Zend_Db_Expr(
        $this->getAdapter()->quoteInto('id_dia = ?', $dia) . ' AND ' .
        $this->getAdapter()->quoteInto('id_cliente = ?', $idCliente) . ' AND ' .
        $this->getAdapter()->quoteInto('idusuario = ?', $idUsuario));
        
        //$logger->log('$where: ' . $where, Zend_Log::INFO);
        
    	$this->update(array('atendido'=>$idAtendido), $where);
    }

}

